/*
 * GraphicEngine.cpp
 *
 *  Created on: 29 nov. 2012
 *      Author: johan
 */

#include "GraphicEngine.h"
#include "TextureManager.h"

#include "LayerMan.h"
#include "OGLWin.h"

#define NB_LAYER 10

using namespace std;

namespace ge {
	GraphicEngine::GraphicEngine()
	{
		cout<<"creating graphic engine"<<endl;

		layerManager = new LayerMan(NB_LAYER);
		window = new OGLWin(200,200);
	}

	void GraphicEngine::loadAllTextures(){
		TextureManager* tm = ge::TextureManager::getInstance();
		tm->loadAll();
	}

	void GraphicEngine::render(){
		layerManager->render();
	}

	void GraphicEngine::resizeWin(int w, int h){
		window->resize(w,h);
	}

	GraphicEngine::~GraphicEngine()
	{
		cout<<"deleting graphic engine"<<endl;

		delete layerManager;
		delete window; //ainsi que son contexte OGL
	}

} /* namespace ge */
